# Maintainer: Jan de Groot <jgc@archlinux.org>
# Contributor: Alexander Baldeck <alexander@archlinux.org>

pkgname=xterm
pkgver=337
pkgrel=1
pkgdesc="X Terminal Emulator"
arch=('x86_64')
url="http://invisible-island.net/xterm/"
license=('custom')
depends=('libxft' 'libxaw' 'ncurses' 'xorg-luit' 'xbitmaps' 'libutempter' 'libxkbfile')
source=(ftp://ftp.invisible-island.net/${pkgname}/${pkgname}-${pkgver}.tgz{,.asc}
        LICENSE)
sha256sums=('ccac77ded347e78d5ffb69b381adf8b2377ce66644b8bec6308aaf19b9aecfa7'
            'SKIP'
            '9929684f5e28eb5e49c5a7f924dec9c61e0b909b3debb92d247f73f222e09615')
validpgpkeys=('C52048C0C0748FEE227D47A2702353E0F7E48EDB') # "Thomas Dickey <dickey@invisible-island.net>"

build() {
  cd ${pkgname}-${pkgver}
  ./configure --prefix=/usr \
      --libdir=/etc \
      --mandir=/usr/share/man \
      --with-app-defaults=/usr/share/X11/app-defaults/ \
      --with-x \
      --disable-full-tgetent \
      --disable-imake \
      --enable-ansi-color \
      --enable-88-color \
      --enable-256-color \
      --enable-broken-osc \
      --enable-broken-st \
      --enable-load-vt-fonts \
      --enable-i18n \
      --enable-wide-chars \
      --enable-doublechars \
      --enable-warnings \
      --enable-tcap-query \
      --enable-logging \
      --enable-dabbrev \
      --enable-freetype \
      --enable-luit \
      --enable-mini-luit \
      --enable-narrowproto \
      --enable-exec-xterm \
      --enable-sixel-graphics \
      --enable-regis-graphics \
      --with-tty-group=tty \
      --with-utempter
  make
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install
  chmod 0755 "${pkgdir}/usr/bin/xterm"

  install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
  install -m644 "${srcdir}/LICENSE" \
      "${pkgdir}/usr/share/licenses/${pkgname}/"
  install -m755 -d ${pkgdir}/usr/share/applications
  install -m644 ${srcdir}/${pkgname}-${pkgver}/{xterm,uxterm}.desktop ${pkgdir}/usr/share/applications/
}
